<html><!-- Created using the cpp_pretty_printer from the dlib C++ library.  See http://dlib.net for updates. --><head><title>dlib C++ Library - map_pair.h</title></head><body bgcolor='white'><pre>
<font color='#009900'>// Copyright (C) 2003  Davis E. King (davis@dlib.net)
</font><font color='#009900'>// License: Boost Software License   See LICENSE.txt for the full license.
</font><font color='#0000FF'>#ifndef</font> DLIB_MAP_PAIr_INTERFACE_
<font color='#0000FF'>#define</font> DLIB_MAP_PAIr_INTERFACE_

<font color='#0000FF'>namespace</font> dlib
<b>{</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>    
    <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font>
        <font color='#0000FF'>typename</font> T1,
        <font color='#0000FF'>typename</font> T2
        <font color='#5555FF'>&gt;</font>
    <font color='#0000FF'>class</font> <b><a name='map_pair'></a>map_pair</b>  
    <b>{</b>
        <font color='#009900'>/*!
            POINTERS AND REFERENCES TO INTERNAL DATA
                None of the functions in map_pair will invalidate
                pointers or references to internal data when called.

            WHAT THIS OBJECT REPRESENTS
                this object is used to return the key/value pair used in the 
                map and hash_map containers when using the enumerable interface.

                note that the enumerable interface is defined in
                interfaces/enumerable.h
        !*/</font>

    <font color='#0000FF'>public</font>:
        <font color='#0000FF'>typedef</font> T1 key_type;
        <font color='#0000FF'>typedef</font> T2 value_type;

        <font color='#0000FF'>virtual</font> ~<b><a name='map_pair'></a>map_pair</b><font face='Lucida Console'>(</font>
        <font face='Lucida Console'>)</font><font color='#5555FF'>=</font><font color='#979000'>0</font>;

        <font color='#0000FF'>virtual</font> <font color='#0000FF'>const</font> T1<font color='#5555FF'>&amp;</font> <b><a name='key'></a>key</b><font face='Lucida Console'>(</font> 
        <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <font color='#5555FF'>=</font><font color='#979000'>0</font>;
        <font color='#009900'>/*!
            ensures
                - returns a const reference to the key
        !*/</font>

        <font color='#0000FF'>virtual</font> <font color='#0000FF'>const</font> T2<font color='#5555FF'>&amp;</font> <b><a name='value'></a>value</b><font face='Lucida Console'>(</font>
        <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font> <font color='#5555FF'>=</font><font color='#979000'>0</font>;
        <font color='#009900'>/*!
            ensures
                - returns a const reference to the value associated with key
        !*/</font>

        <font color='#0000FF'>virtual</font> T2<font color='#5555FF'>&amp;</font> <b><a name='value'></a>value</b><font face='Lucida Console'>(</font>
        <font face='Lucida Console'>)</font><font color='#5555FF'>=</font><font color='#979000'>0</font>;
        <font color='#009900'>/*!
            ensures
                - returns a non-const reference to the value associated with key
        !*/</font>

    <font color='#0000FF'>protected</font>:

        <font color='#009900'>// restricted functions
</font>        map_pair<font color='#5555FF'>&lt;</font>T1,T2<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> <b><a name='operator'></a>operator</b><font color='#5555FF'>=</font><font face='Lucida Console'>(</font><font color='#0000FF'>const</font> map_pair<font color='#5555FF'>&lt;</font>T1,T2<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font><font face='Lucida Console'>)</font> <b>{</b><font color='#0000FF'>return</font> <font color='#5555FF'>*</font><font color='#0000FF'>this</font>;<b>}</b> <font color='#009900'>// no assignment operator
</font>
    <b>}</b>;

    <font color='#009900'>// destructor does nothing
</font>    <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> T1,<font color='#0000FF'>typename</font> T2<font color='#5555FF'>&gt;</font> 
    map_pair<font color='#5555FF'>&lt;</font>T1,T2<font color='#5555FF'>&gt;</font>::~<b><a name='map_pair'></a>map_pair</b> <font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <b>{</b><b>}</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<b>}</b>

<font color='#0000FF'>#endif</font> <font color='#009900'>// DLIB_MAP_PAIr_INTERFACE_
</font>

</pre></body></html>